<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改密码</title>
<script type="text/javascript" src="js/jquery-easyui-1.5.4.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"></script>
<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.5.4.2/themes/icon.css"/>
<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.5.4.2/themes/black/easyui.css"/>
<link rel="stylesheet" type="text/css" href="css/taojin/layout.css"> 
</head>
<body>
	<script type="text/javascript">
	//导入datagrid表格
	$(function() {

		$.extend($.fn.validatebox.defaults.rules, {
			passowrd : {
				validator : function(value, param) {
					return value.length >= param[0] && value.length <= param[1]
				},
				message : '密码必须大于{0}小于{1}'
			},
			equals: {
				validator:function(value,param){
					return value == $(param[0]).val();
				},
				message:'密码必须与上列一致'
			}
			
		});
		
		$("#eidtPassword-button").linkbutton({
			onClick:function(){
				$("#editPassword-form").form({
					url:'editPassword',
					method:'post',
					onSubmit:function(param){
						return $(this).form('validate');
					},
					success:function(data){
						if (data=='true') {
							$.messager.alert('提示',"修改成功!");
							$("#oldPassword").passwordbox('clear');
							$("#newPassword").passwordbox('clear');
							$("#newPassword2").passwordbox('clear');
						}else {
							$.messager.alert('警告',"修改失败!请检查密码");
							$("#oldPassword").passwordbox('clear');
							$("#newPassword").passwordbox('clear');
							$("#newPassword2").passwordbox('clear');
						}
					}
				}).submit();
			}
		});
	})
	
	</script>
	
	<div id="edit-password-layout" class="easyui-layout" data-options="fit:true,border:false" >
		<div data-options="region:'center'">
		<form method="post" id="editPassword-form">
			<div style="height: 300px;width: 520px;border: 1px solid white;border-radius: 5px;margin-left: 200px;margin-top: 50px;">
				<div style="padding-top: 50px;padding-left: 70px;">
					<input id="oldPassword" name="oldPassword" class="easyui-passwordbox" style="font-size: 18px;"
						data-options="label:'原密码:',labelWidth:55,width:350,height:35,required:true,validType:'password[5,20]'
						,validateOnCreate:false">
				</div>
				
				<div style="padding-top: 15px;padding-left: 70px;">
					<input id="newPassword" name="newPassword" class="easyui-passwordbox" style="font-size: 18px;"
						data-options="label:'新密码:',labelWidth:55,width:350,height:35,required:true,validType:'password[5,20]',
						validateOnCreate:false">
				
				</div>
				
				<div style="padding-top: 15px;padding-left: 45px;">
					<input id="newPassword2" name="newPassword2" class="easyui-passwordbox" style="font-size: 18px;"
						data-options="label:'重复新密码:',labelWidth:80,width:375,height:35,required:true,validateOnCreate:false"
						validType="equals['#newPassword']">
				</div>
		</form>
				<div style="padding-left: 210px;padding-top: 50px;font-size:20px;">
					<a id="eidtPassword-button" class="easyui-linkbutton" 
					style="height: 40px;width: 100px;"
						data-options="text:'提交'"></a>
				</div>
				
			</div>
		</div> 
    </div>
</body>
</html>